class CreateDealDetails < ActiveRecord::Migration
  def self.up
    create_table :deal_details, :primary_key => "deal_detail" do |table|\
      table.column :deal_id, :integer, :null => false
      table.column :room, :boolean # true: open
      table.column :deal_data, :string
      table.column :auction, :string
      table.column :auc_desc, :string
      table.column :cardsplay, :string
      table.column :openlead, :string
      table.column :contract, :string
      table.column :tricks, :integer
      table.column :comments, :string
      table.column :created_at, :date, :null => false
    end
#    execute "
#      ALTER TABLE deal_details ADD FOREIGN KEY (deal_id) REFERENCES deals (deal_id);
#    "
  end

  def self.down
    drop_table :deal_details
  end
end
